<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
    <meta name="theme-color" content="#02a30f">

    <!-- <script type="application/wasm" src="olm.wasm"></script> -->
    <script type="text/javascript" src="olm_legacy.js"></script>
    <script type="text/javascript" src="browser-matrix.min.js"></script>
    <script type="text/javascript" src="webcrypto.js"></script>
    <!-- <script type="text/javascript" src="crypto-attachments.js"></script> -->

  </head>
  <style>
    * {
	    font-family: "Open Sans";
	    margin: 0;
      /* overflow: hidden; */
	    border-radius: 0;
    }
    body {
      overflow: hidden;
      height: 320px;
      width: 240px;
    }
    html {
	    font-size: 10px;
    }
    pre {
      white-space: pre-wrap;       /* Since CSS 2.1 */
      white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
      white-space: -pre-wrap;      /* Opera 4-6 */
      white-space: -o-pre-wrap;    /* Opera 7 */
      word-wrap: break-word;       /* Internet Explorer 5.5+ */
    }

    header#title {
	    position: fixed;
	    top: 0;
	    width: 100%;
      flex-shrink: 0;
      z-index: 1;
    }

    header h1 {
	    line-height: 2.5rem;
	    background: #02a30f;
	    color: #fff;
	    padding: 0 1rem;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    white-space: nowrap;
	    font-weight: 300
	    text-align: center;
    }
    #content {
	    /* padding-left: 5px; */
	    /* padding-right: 5px; */
      /* overflow: auto; */
      /* height: 100%; */
      /* margin-bottom: 45px; */

      /* margin-top: 25px; */
      position: absolute;
      top: 25px;
      height: 100%;
      display: flex;
      flex-direction: column;
      width: 100%;
    }
    #room-menu {
	    padding-left: 5px;
	    padding-right: 5px;
      overflow: auto;
      height: 100%;
      margin-bottom: 45px;
    }
    #menu {
	    padding-left: 5px;
	    padding-right: 5px;
      overflow: auto;
      height: 100%;
      margin-bottom: 45px;
      display: none;
    }
    #chat {
      overflow: auto;
      height: 100%;
      /* margin-bottom: 60px; */
      display: none;
      flex-direction: column;
      position: fixed;
      top: 25px;
      width: 100%;
    }
    #chat-textbox {
      position: fixed;
      bottom: 25px;
      width: 100%;
    }
    .active {
      background-color: lightgray;
    }

    #navigator {
	    bottom: 0;
	    left: 0;
	    right: 0;
      position: fixed;
	    font-weight: bold;
	    background: #ddd;
	    line-height: 2rem;
	    font-size: 15px;
      display: flex;
      justify-content: space-between;
      flex-shrink: 0;
      padding-right: 5px;
      padding-left: 5px;
      align-items: center;
      height: 25px;
    }
    #navigator span{
	    display: inline-block;
    }
    #left {
	    text-align: left;
	    /* float: left; */
      min-width: 33.333%;
      /* margin-left: 5px; */
    }
    #right {
	    text-align: right;
	    /* float: right */
      min-width: 33.333%;
      /* margin-right: 5px; */
    }
    #middle {
      min-width: 33.333%;
      text-align: center;
    }
    #conversation {
      display: flex;
      flex-direction: column;
      overflow: scroll;
      height: 100%;
      /* margin-bottom: 56px; */
      /* margin-top: 25px; */
      flex: 0 1 auto;
    }
    #conversation-buffer {
      flex: 0 0 82px;
    }
    .msgItem {
      /* width: 100%; */
      margin-bottom: 5px;
      display: flex;
      flex-direction: column;
      padding-top: 5px;
    }
    .msgItem-selected {
      background-color: lightgray;
    }
    .msgInnerItem {
      max-width: 75%;
      overflow-wrap: break-word;
      padding: 5px 10px 5px 10px;
      border-radius: 5px;
      border: 1px black solid;
      position: relative;
    }
    .msgItem pre {
      margin: unset;
      font-size: 16px;
    }
    #login {
      display: none;
    }
    .roomItem {
      font-size: 14px;
      padding: 5px;
    }
    .menuItem {
      font-size: 14px;
      padding: 5px;
    }
    .typing {
      margin: 5px;
      width: 90%;
      text-align: center;
    }
    .editing {
      padding: 5px;
      position: fixed;
      left: 0px;
      bottom: 55px;
      display: none;
      background-color: orange;
      border-radius: 5px;
    }
    .replying {
      padding: 5px;
      position: fixed;
      right: 0px;
      bottom: 55px;
      display: none;
      background-color: orange;
      border-radius: 5px;
    }
    .reactions {
      display: flex;
      align-items: center;
    }
    blockquote {
      border-left: 1px solid black;
      padding-left: 5px;
    }
    .play-button-container {
      position: absolute;
      height: calc(100% - 10px);
      width: calc(100% - 20px);
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .play-button {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 30px;
      height: 30px;
      background-color: #0000007a;
      color: white;
      border-radius: 15px;
    }
  </style>
  <script type="text/javascript" src="kmc.js"></script>
  <body>
	  <header id="title">
      <h1 id="title-text"></h1>
    </header>
    <div id="content">
      <div id="navigator">
        <span id="left"></span>
        <span id="middle"></span>
        <span id="right"></span>
      </div>
      <div id="login">
        <label for="fname">Home Server:</label>
        <br>
        <input
          type="text"
          id="homeserver"
          class="login-text"
          value=""
          placeholder="https://matrix.org"
          />
        <br>
        <label for="fname">User:</label>
        <br>
        <input
          type="text"
          id="user"
          class="login-text"
          placeholder="@username:matrix.org"
          />
        <br>
        <label for="lname">Password:</label>
        <br>
        <input
          type="password"
          id="password"
          class="login-text"
          />
      </div>
      <div id="room-menu"></div>
      <div id="menu"></div>
      <div id="chat">
        <div id="conversation"></div>
        <div id="conversation-buffer"></div>
        <div id="editing" class="editing">Editing...</div>
        <div id="replying" class="replying">Replying...</div>
        <div id="uploading" class="replying"></div>
        <textarea id="chat-textbox" autofocus="true" rows="1" type="text" placeholder="Message"/>
      </div>
    </div>
  </body>
</html>
